import Vue from 'vue'
import App from './App.vue'
import router from './router'

// Vue.config.productionTip = false

let instance = null

function render(props) {
  instance = new Vue({
    router,
    render: h => h(App)
  }).$mount('#app')
}

if (window._POWERED_BY_QIANKUN_) {
  __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
}

//独立运行子应用
if (!window._POWERED_BY_QIANKUN_) { 
  render()
}

// 必须导出promise
export async function bootstrap(props){}
export async function mount(props){
  render(props)
}
export async function unmount(props) {
  instance.$destroy()
}
